using System;

namespace PropertyExpression.PresentationCode
{
    public static class ChainExtensions
    {
        public static T Execute<T>(this T arg, Action<T> action)
        {
            action(arg);
            return arg;
        }

        public static TResult Execute<T, TResult>(this T arg, Func<T, TResult> action)
        {
            return action(arg);
        }

        public static T Out<T>(this T it, out T target)
        {
            target = it;
            return it;
        }
    }
}